let util = require('../../../../../common/util/util')

Page({
    data: {
        list: []
    },

    onLoad: function (options) {
        this.xInit()
    },
    // 团体信息
    xInit: function () {
        let that = this
        wx.cloud.callFunction({
            name: 'consulting_message',
            data: {
                action: "get_user_list_for_message"
            }
        }).then(res => {
            console.log("返回数据:", res)
            let data = res.result
            for(var i in data){
                data[i].create_time = util.formatDate_chinese(new Date(data[i].create_time))
            }
            that.setData({
                list : data
            })
        })
    },
    // 解锁
    xTolock:function () {
      let that =this;
    },
    // 解锁提示
    xLock:function () {
      let that =this;
      wx.showModal({
        title: "提示",
        content: "解锁后，所有成员即可进入新模块",
        showCancel: true,
        success (res) {
          if (res.confirm) {
            that.xTolock()
            console.log('用户点击确定')
          } else if (res.cancel) {
            
          }
        }
      })
    },
    xToDet : function (e) {
      let params = e.currentTarget.dataset
      wx.navigateTo({
          url: '/subdter/pages/mine/xtask/detail/index',
          success: (res) => {
              res.eventChannel.emit('xToDetail', params)
          }
        })
    },
})